Default States Machine
class DefaultStatesMachine(statesManager: StatesManager, handlers: List<StateHandlerHolder<*>>) : StatesMachine
Content copied to clipboard
Default realization of StatesMachine. It uses statesManager for incapsulation of States storing and contexts resolving, and uses launchStateHandling for State handling
Constructors
DefaultStatesMachine
Link copied to clipboard
fun DefaultStatesMachine(statesManager: StatesManager, handlers: List<StateHandlerHolder<*>>)
Content copied to clipboard
Functions
handle State
Link copied to clipboard
open suspend override fun StatesMachine.handleState(state: State): State?
Content copied to clipboard
Will call launchStateHandling for state handling
start
Link copied to clipboard
Launch handling of states. On statesManager, statesManager will be called lambda with performing of state. If launchStateHandling will returns some State then statesManager will be used, otherwise StatesManager.endChain.
start Chain
Link copied to clipboard
Just calls StatesManager.startChain of statesManager